from rest_framework.views import APIView
from rest_framework.permissions import AllowAny
from utilities.captcha import Code


class CaptchaView(APIView):
    """
    get:
    获取验证码
    """

    permission_classes = [
        AllowAny,
    ]

    def get(self, request, *args, **kwargs):
        code = Code(request)
        code.type = 'world'
        return code.display()
